//
//  HouserInfoModel.m
//  sellHouse
//
//  Created by 李 佳伟 on 2018/11/26.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "HouserInfoModel.h"

@implementation HouserInfoModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key  {
    if([key isEqualToString:@"id"]){
        self.Newid = value==nil?@"":value;
    }
}

- (void)setNilValueForKey:(NSString *)key{
    
}
//有些属性 为空了我后续用到经常会崩溃 下面这个方法把<null>转为空字符串

-(void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:keyedValues];
    NSArray *valueArray = [dic allKeys];
    for (NSString *key in valueArray) {
        if ([[dic objectForKey:key] isEqual:[NSNull null]] || [dic objectForKey:key]==nil) {
            [dic setValue:@"" forKey:key];
        }
    }
    [super setValuesForKeysWithDictionary:keyedValues];
}

@end
